/**
 * Created by IntelliJ IDEA.
 * Time: 9:01
 * @Author: xyb
 * @Version: 2017/6/29
 * To change this template use File | Settings | File Templates.
 */

(function () {

    var message = {};

    var getUserFriends_url = "/message/get_user_friends.json";
    var showCurrChatMsg_url = "/message/on_show_curr_chat_msg.json";


    backService.message = message;

    /**
     * 获取好友列表
     * @param userId
     * @param callback
     * @param failure
     */
    message.getUserFriends = function (userId, callback, failure) {
        backService.post(getUserFriends_url, {
            userId: userId
        }, callback, failure);
    };

    /**
     * 获取与好友 的聊天信息
     * @param userId
     * @param toUserId
     * @param callback
     * @param failure
     */
    message.showCurrChatMsg = function (userId, toUserId, pageNum, callback, failure) {
        backService.post(showCurrChatMsg_url, {
            userId: userId,
            toUserId: toUserId,
            pageNum: pageNum
        }, callback, failure);
    };

})();